// pages/place/place.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    array: [

      {
        id: 0,
        name: "沂蒙山旅游区龟蒙景区",
        desc: "世界地质公园--平邑县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/1b4c510fd9f9d72ae8cd9ccdda2a2834359bbbb1?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2U4MA==,xp_5,yp_5",
        extras: "世界地质公园-平邑县",
      },
      {
        id: 1,
        name: "沂蒙山旅游区云蒙景区",
        desc: "世界地质公园--蒙阴县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/241f95cad1c8a786906a28706d09c93d70cf500f?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxMTY=,xp_5,yp_5",
        extras: "世界地质公园-蒙阴县",
      },
      {
        id: 2,
        name: "沂水雪山彩虹谷",
        desc: "观光、休闲、度假、娱乐、参与、表演于一体的高档旅游区--沂水县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/55e736d12f2eb938b45e0351dd628535e5dd6f65?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxODA=,xp_5,yp_5",
        extras: "",
      },
      {
        id: 3,
        name: "王羲之故居",
        desc: "古典园林式建筑，为全国重点文物保护单位--兰山区",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/b64543a98226cffcaf71c89eb4014a90f603ea47?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxMTY=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 4,
        name: "临沂动植物园",
        desc: "鲁南苏北地区唯一大型综合生态旅游目的地--河东区",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/342ac65c103853431bc1cbdd9a13b07ecb8088c4?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UyMjA=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 5,
        name: "兰陵国家农业公园",
        desc: "山东省唯一国家农业公园、规模最大的生态农业旅游庄园--兰陵县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/faedab64034f78f0d8b4115170310a55b2191cd0?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2U4MA==,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 6,
        name: "临沂极地海洋世界",
        desc: "高起点、高品质、高科技、国内领先、世界一流的科普公益性旅游项目--河东区",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/b999a9014c086e06c0143f170f087bf40ad1cb2a?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxMTY=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 7,
        name: "华东革命烈士陵园",
        desc: "国务院第一批“全国重点烈士纪念建筑物保护单位”--兰山区",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/0bd162d9f2d3572c8f10d5998713632763d0c381?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxODA=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 8,
        name: "孟良崮旅游区",
        desc: "中国红色旅游十大景区之一” 全国爱国主义教育基地--沂南县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/3801213fb80e7bec037a2903262eb9389a506bab?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2U5Mg==,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 9,
        name: "山东地下大峡谷",
        desc: "我国特大型溶洞之一，被誉为“中国地下河漂流第一洞”--沂水县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/6a600c338744ebf8e75614c2d0f9d72a6059a72c?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxMTY=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 10,
        name: "天宇自然博物馆",
        desc: "世界上最大的自然地质博物馆和最大的恐龙博物馆--平邑县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/d788d43f8794a4c21da2b84009f41bd5ac6e39d3?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxMTY=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 11,
        name: "皇山东夷文化公园",
        desc: "以东夷文化为纽带，再现历史人文景观，全方位演绎东夷神话故事--河东区",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/7acb0a46f21fbe0933781d9a69600c338744ad1e?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UxNTA=,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 12,
        name: "中华奇石城",
        desc: "中国最大的观赏石基地，山东省重点文化旅游产业项目--费县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/6f061d950a7b02089cfa30d463d9f2d3572cc8d0?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2U4MA==,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 13,
        name: "观唐温泉",
        desc: "“江北第一、全国领先”的大型露天温泉公园--河东区",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/3812b31bb051f819c8c08e5fdfb44aed2e73e73a?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2U4MA==,xp_5,yp_5",
        extras: "备注",
      },
      {
        id: 14,
        name: "沂蒙山银座天蒙旅游区",
        desc: "以沂蒙山水文化为特色,集生态宗教民俗红色旅游和休闲度假于一体的综合型国际旅游区--费县",
        imgUrl: "https://bkimg.cdn.bcebos.com/pic/ae51f3deb48f8c5452d3351532292df5e0fe7f8c?x-bce-process=image/watermark,g_7,image_d2F0ZXIvYmFpa2UyNzI=,xp_5,yp_5",
        extras: "备注",
      },


    ],
  },

  // 点击item的时候执行
  onItemClick: function(e) {
    console.log(e);

    let that = this;
    let index = e.currentTarget.dataset.index;
    console.log('index = ' + index);

    var imgArr = [];
    for (let i = 0; i < this.data.array.length; i++) {
      imgArr[i] = this.data.array[i].imgUrl;
    }

    wx.previewImage({
      current: that.data.array[index].imgUrl,
      urls: imgArr,
      success: function(res) {
        console.log(res)
      }
    })
  },

  // 下拉刷新
  onPullDownRefresh: function() {
    var n1 = setTimeout(function() {
      wx.showToast({
        success: "loading",
        title: '数据已更新',
      });
      clearTimeout(n1);
    }, 3000);
  },

  // 到达底部
  onReachBottom: function() {
    wx.showToast({
      title: '我是有底线的',
    })
  },

})